<template>
  <div>
    <ul>
      <li v-for="item in goodsList" :key="item.id" @click="$router.push('/detail')">
        <img :src="item.list_pic_url" alt="" />
        <p>{{ item.name }}</p >
        <p class="p">{{ item.retail_price | formatMoney }}</p >
      </li>
    </ul>
  </div>
</template>
<script>
import { searchgoods } from "@/utils/http";
export default {
  name: "Categorysed",
  props: ["name"],
  data() {
    return {
        goodsList:[],
    };
  },
  computed: {},
  components: {},
  methods: {},
  created() {
    console.log(this.name);
    searchgoods({categoryId:this.name,page:1,size:1000}).then(res=>{
        this.goodsList=res.data.data.goodsList
        console.log(res);
    })
  },
  mounted() {},
};
</script>
<style lang="less" scoped>
ul {
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  li {
    width: 45%;
    img {
      width: 100%;
    }
    p{
        font-size: 16px;
        text-align: center;
    }
    .p{
        color: #8b0000;
        padding-top: 8px;
    }
  }
}
</style>